package com.love.travel.service.impl;

import java.util.List;
import com.love.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.love.travel.mapper.TravelTagMapper;
import com.love.travel.domain.TravelTag;
import com.love.travel.service.ITravelTagService;

/**
 * 旅游标签Service业务层处理
 * 
 * @author love
 * @date 2025-10-18
 */
@Service
public class TravelTagServiceImpl implements ITravelTagService 
{
    @Autowired
    private TravelTagMapper travelTagMapper;

    /**
     * 查询旅游标签
     * 
     * @param tagId 旅游标签主键
     * @return 旅游标签
     */
    @Override
    public TravelTag selectTravelTagByTagId(Long tagId)
    {
        return travelTagMapper.selectTravelTagByTagId(tagId);
    }

    /**
     * 查询旅游标签列表
     * 
     * @param travelTag 旅游标签
     * @return 旅游标签
     */
    @Override
    public List<TravelTag> selectTravelTagList(TravelTag travelTag)
    {
        return travelTagMapper.selectTravelTagList(travelTag);
    }

    @Override
    public List<TravelTag> selectTravelTagByCategoryList(TravelTag travelTag) {
        return travelTagMapper.selectTravelTagByCategoryList(travelTag);
    }

    /**
     * 新增旅游标签
     * 
     * @param travelTag 旅游标签
     * @return 结果
     */
    @Override
    public int insertTravelTag(TravelTag travelTag)
    {
        travelTag.setCreateTime(DateUtils.getNowDate());
        return travelTagMapper.insertTravelTag(travelTag);
    }

    /**
     * 修改旅游标签
     * 
     * @param travelTag 旅游标签
     * @return 结果
     */
    @Override
    public int updateTravelTag(TravelTag travelTag)
    {
        travelTag.setUpdateTime(DateUtils.getNowDate());
        return travelTagMapper.updateTravelTag(travelTag);
    }

    /**
     * 批量删除旅游标签
     * 
     * @param tagIds 需要删除的旅游标签主键
     * @return 结果
     */
    @Override
    public int deleteTravelTagByTagIds(Long[] tagIds)
    {
        return travelTagMapper.deleteTravelTagByTagIds(tagIds);
    }

    /**
     * 删除旅游标签信息
     * 
     * @param tagId 旅游标签主键
     * @return 结果
     */
    @Override
    public int deleteTravelTagByTagId(Long tagId)
    {
        return travelTagMapper.deleteTravelTagByTagId(tagId);
    }
}
